#ifndef _GPIO_DRIVER

#define _GPIO_DRIVER

#include <avr/io.h>

// Setup Data Direction Register

typedef union
{
	unsigned char byte;

	struct
	{
		unsigned char		bit0	: 1;
		unsigned char		bit1	: 1;
		unsigned char		bit2	: 1;
		unsigned char		bit3	: 1;
		unsigned char		bit4	: 1;
		unsigned char		bit5	: 1;
		unsigned char		bit6	: 1;
		unsigned char		bit7	: 1;	
	} bits;

} Byte;


typedef Byte dataDirection;


#define allON 0x00
#define allOFF 0xFF

#define allInputs 0x00
#define allOutputs 0xFF
#define input 1
#define output 0
#define portADirection allOutputs
#define portBDirection 0b00001111 // All Inputs but the SPI signals
#define portCDirection 0b00000011 // Inputs but the SCL and SDA pins
#define portDDirection 0b00000011 // Inputs but the RXD and TXD pins

void setPortsDirection();


#endif
